﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Test
{
    public partial class Form2 : Form
    {
        public Token ReturnToken;
        public Form2(Token t)
        {
            InitializeComponent();
            this.ReturnToken = t;
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            this.timer1.Enabled = true;
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (this.ReturnToken.Flag) {
                this.timer1.Enabled = false;
                this.timer1.Stop();
                this.Dispose();
            }
                
        }
    }

    public class Token {
        public bool Flag = false;
    }

}
